Add a 'clear trap table' path to set_trap_table hypercall, taken when
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Fri, 3 Mar 2006 09:34:03 +0000 (10:34 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Fri, 3 Mar 2006 09:34:03 +0000 (10:34 +0100)
the input table is NULL.

Also, no need for set_trap_table to take the per-domain biglock.

Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/traps.c

index 97cf8bb5ab66761c1b719929c007afd58a438da9..78bff071d81470b9e8dad65c93fb82b4de128c88 100644 (file)
@@ -1410,7 +1410,13 @@ long do_set_trap_table(struct trap_info *traps)
     struct trap_info *dst = current->arch.guest_context.trap_ctxt;
     long rc = 0;
 
-    LOCK_BIGLOCK(current->domain);
+    /* If no table is presented then clear the entire virtual IDT. */
+    if ( traps == NULL )
+    {
+        memset(dst, 0, 256 * sizeof(*dst));
+        init_int80_direct_trap(current);
+        return 0;
+    }
 
     for ( ; ; )
     {
@@ -1440,8 +1446,6 @@ long do_set_trap_table(struct trap_info *traps)
         traps++;
     }
 
-    UNLOCK_BIGLOCK(current->domain);
-
     return rc;
 }